<?php
/**
 * User: aka
 * Time: 21:58
 */

namespace app\read\controller;

use app\validate\goodsEntry\QueryGoodsEntry;
use think\Request;

class GoodsEntry
{
    public function queryGoodsEntry(Request $request)
    {
        $validate = new QueryGoodsEntry();
        if (!$validate->check($request->param())) {
            return json($validate->getError());
        }else {
            $queryName = $request->param('name');
            if (empty(trim($queryName)))
            {
                return json('输入有误！');
            }
            $queryList = \app\tenno\model\GoodsEntry::stuffName($queryName)
                ->deleteState(0)
                ->select();
            return json(['state' => 200, 'data' => $queryList]);
        }
    }
}